/*
 * Copyright (c) 2019, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2019-08-26     sogwms       The first version
 */

#ifndef __SINGLE_PWM_MOTOR_H__
#define __SINGLE_PWM_MOTOR_H__

#include "motor.h"
#include <aos/aos.h>
#include <devices/pwm.h>
#include <devices/driver.h>
#include <devices/devicelist.h>
#include "aos/cli.h"
#include <drv/gpio_pin.h>

struct single_pwm_motor
{
    struct motor mot;
    rvm_dev_t *pwm_dev;
    int channel;
    csi_gpio_pin_t pin1;
    csi_gpio_pin_t pin2;
};

struct single_pwm_motor;
typedef struct single_pwm_motor *single_pwm_motor_t;

single_pwm_motor_t single_pwm_motor_create(char *pwm, int channel, pin_name_t pin1, pin_name_t pin2);

#endif // __SINGLE_PWM_MOTOR_H__
